import { debounce as debounceFn } from 'lodash';
// 过滤选项
export const filterOption = (input: string, option: any) => {
	return option.code.toLowerCase().includes(input.toLowerCase());
};

// 防抖函数
export const debounce = (func: Function, delay: number = 300) => {
	return debounceFn(func, delay);
};

export const getPartnerName = (partnerType: string): string => {
	switch (partnerType) {
		case 'first':
			return '店中店';
		case 'second':
			return '运营中心';
		case 'third':
			return '分公司';
		default:
			return '-';
	}
};

// 获取来源名称
export const getSourceName = (source: number): string => {
	switch (source) {
		case 1:
			return '官方来源';
		case 2:
			return '红娘';
		case 3:
			return '婚介所';
		default:
			return '';
	}
};
